﻿/*
* 创建人:            @Model.Author
* 创建时间:          @Model.CreateTime
* 邮箱：             @Model.EmailAddress
* 文件功能描述：      @Model.FileRemark
*
* 修改人：
* 时间：
* 修改说明：
*/
@using SJNScaffolding.WPF.Extend
@model SJNScaffolding.Models.TemplateModels.ViewFileModel
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Abp.Domain.Repositories;
using @(Model.ProjectName).Domain.Plat.@(Model.TableName)s.Dto;
using @(Model.ProjectName).Usual;

namespace @(Model.ProjectName).Domain.Plat.@(Model.TableName)s
{
    public class @(Model.TableName)AppService : UsualCrudAppService<@(Model.TableName+",")@(Model.TableName)ListDto, @(Model.TableName)SearchDto, @(Model.TableName)InputDto, @Model.IdType>, I@(Model.TableName)AppService
    {
        private readonly IRepository<@(Model.TableName+",")@(Model.IdType)>_i@(Model.TableNameCamel)Repository;

        public @(Model.TableName)AppService(IRepository<@(Model.TableName+",")long>i@(Model.TableNameCamel)Repository) : base(i@(Model.TableNameCamel)Repository)
        {
            _i@(Model.TableNameCamel)Repository = i@(Model.TableNameCamel)Repository;
            @if(Model.HasPermission){
                @RazorHelper.RawHtml("          base.GetPermissionName =\"Plat."+Model.TableName+"\";\r\n");
                @RazorHelper.RawHtml("          base.GetAllPermissionName = \"Plat." + Model.TableName + ".GetGrid\";\r\n");
                @RazorHelper.RawHtml("          base.CreatePermissionName = \"Plat."+Model.TableName+".Add\";\r\n");
                @RazorHelper.RawHtml("          base.UpdatePermissionName = \"Plat."+Model.TableName+".Edit\";\r\n");
                @RazorHelper.RawHtml("          base.DeletePermissionName = \"Plat."+Model.TableName+".Delete\";\r\n");
            }
        }

        protected override IQueryable<@(Model.TableName)> CreateFilteredQuery(@(Model.TableName)SearchDto input)
        {
            return base.CreateFilteredQuery(input);
        }
    }
}
